/*
 * window-ctrl.cpp
 *
 *  Created on: 12.03.2013
 *      Author: SomeChineseGuy
 */

#include <stdlib.h>
#include <iostream>

#include <GL/glfw.h>

#include "window-ctrl.h"
#include "properties-parse.h"
#include "constants.h"


int createWindow() {

	//PropertiesParser* initialWinConfig = new PropertiesParser(WINDOW_CONFIG_STARTUP_FILE);

	/*initialWinConfig->parseProperties();

	int width		= atoi(initialWinConfig->getPropertyByName("width"));
	int height		= atoi(initialWinConfig->getPropertyByName("height"));
	int redbits		= atoi(initialWinConfig->getPropertyByName("redbits"));
	int greenbits	= atoi(initialWinConfig->getPropertyByName("greenbits"));
	int bluebits	= atoi(initialWinConfig->getPropertyByName("bluebits"));
	int alphabits	= atoi(initialWinConfig->getPropertyByName("alphabits"));
	int depthbits	= atoi(initialWinConfig->getPropertyByName("depthbits"));
	int stencilbits	= atoi(initialWinConfig->getPropertyByName("stencilbits"));
	int mode		= atoi(initialWinConfig->getPropertyByName("mode")) == 0 ? GLFW_WINDOW : GLFW_FULLSCREEN;

	GLuint openResult = glfwOpenWindow(width, height, redbits, greenbits, bluebits, alphabits, depthbits, stencilbits, mode);*/

	GLuint openResult = glfwOpenWindow(640,480,0,0,0,0,0,0,GLFW_WINDOW);

	//delete initialWinConfig;

	if (openResult == GL_FALSE) {
		return 1;
	}

	return 0;
}
